/*

Preschool Availability and Female Labor Force Participation: Evidence from Indonesia
Daniel Halim, Hillary C. Johnson, Elizaveta Perova

The World Bank
East Asia Pacific Gender Innovation Lab (EAPGIL)

Version: February 2021

Objective: performs data cleaning, data construction, generates tables, and figrues.

*/


********************************************************************************************
*                             Housekeeping                                                 *
********************************************************************************************

*   =====================================
*   Preparation
*   =====================================

capture log close

drop _all
clear all
set more off


*   =====================================
*   Globals : Select who is working
*   =====================================

global USER				1


* main file path: <file path to replication folder>

	if $USER {
	global project "C:\Users\wb503608\OneDrive - WBG\Preschool FLFP\Replication Package\Replication_18Mar\Replication"
	}

* project folder
	global data   		"$project/Data"
	global dofile 		"$project/Do files"
	global results 		"$project/Results"


* data folders
	* Raw data
		forval i=1/5{
			global ifls_raw`i' "$data/Raw data/IFLS/Wave `i'"
		}
		*global raw "$data/Raw data"
		global raw "C:\Users\wb503608\OneDrive - WBG\Preschool FLFP\Data\Raw data"

	* Cleaned data
		forval i=1/5{
			global ifls_clean`i' "$data/Clean data/IFLS/Wave `i'"
		}
		global clean "$data/Clean data"

local sysdate=c(current_date)

log using "$project/log_setup_`sysdate'.txt", append text

*   =====================================
*   INSTALL PACKAGE (IF NOT INSTALLED YET)
*   =====================================
/* switch it off/on if necessary
ssc install estout
ssc install parmest
ssc install qqvalue
ssc install unique
ssc install coefplot
ssc install spmap
ssc install scheme-burd
ssc install binscatter
*/

set scheme s2mono
*   =====================================
*   CLEANING & DATA CONSTRUCTION
*   =====================================

do "$dofile/01b_cleaning podes susenas.do" // to execute, need access to PODES and SUSENAS dataset
do "$dofile/01c_cleaning ifls.do"

*   =====================================
*   ANALYSIS
*   =====================================

** Tables
do "$dofile/02_tables.do"

** Figures
do "$dofile/03_figures.do"

log close
